'use strict'

const path = require('path')

module.exports = {
  moduleName: 'pages',
  dev: {
    host: '192.168.0.93', // 自己本机id地址
    port: 8089, // 端口
    isDebug: true,
    cdnBase: '"http://192.168.0.93:8089"',
    uriBase: '"/zth2Api"',
    shareUriBase: '"/zth2Api"',
    proxyTable: { // 代理
      '/zth2Api': {
        target: 'http://192.168.0.15:9090',
        changeOrigin: true,
        pathRewrite: {
          '^/zth2Api/': '/'
        }
      }
    },

    assetsSubDirectory: 'static',
    assetsPublicPath: '/',

    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false,
    devtool: 'eval', //最快速度
    cacheBusting: true,
    cssSourceMap: true
  },

  build: {
    isDebug: false,

    uriBase: '"https://www.zetianhui.net/zth2Api"',
    shareUriBase: '"/zth2Api"',
    cdnBase: '"https://cdn.zetianhui.net"',
    assetsPublicPath: 'https://www.zetianhui.net/', //自己测试学习用的,

    uglifyExclude: ['zthJsCallback'], //不混淆的函数
    index: path.resolve(__dirname, '../index.html'),
    assetsRoot: path.resolve(__dirname, '../large-loan'),
    assetsRootName: 'large-loan', // build之后存放的目录名称，和assetsRoot要一致
    assetsSubDirectory: 'static',

    productionSourceMap: false, // 生产环境关闭source-map
    devtool: '#source-map',
    productionGzip: false, // 是否开启压缩，在nginx配置就行了
    productionGzipExtensions: ['js', 'css'],
    bundleAnalyzerReport: process.env.npm_config_report
  }
}
